package com.wangp.mywrite.springboot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.support.SendResult;
import org.springframework.stereotype.Service;
import org.springframework.util.concurrent.ListenableFuture;

/**
 * @author: wp
 * @date: 2023/5/25 15:24:54
 * @desc:
 **/
@Service
public class MessageServiceKafkaImpl{

    @Autowired
    private KafkaTemplate<String,String> kafkaTemplate;


    public void sendMessage(String id){
        ListenableFuture<SendResult<String, String>> wp = kafkaTemplate.send("wp", id);
    }
}
